package com.accp.vehiclecare.dao.hzdao;

import com.accp.vehiclecare.vo.hzvo.goodssource;
import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface goodssourceMapper {
    int deleteByPrimaryKey(Integer goodsid);

    int insert(goodssource record);

    int insertSelective(goodssource record);

    goodssource selectByPrimaryKey(Integer goodsid);

    int updateByPrimaryKeySelective(goodssource record);

    int updateByPrimaryKey(goodssource record);

    @Select("SELECT * FROM `goodssource` WHERE `supplierasid` =#{id}")
    List<goodssource> showlist(@Param("id") Integer id);
    @Select("SELECT * FROM `goodssource`")
    List<goodssource> showlist2();
    @Delete("DELETE  FROM `goodssource` WHERE `goodsid`=#{id}")
    int deletegoodssource(@Param("id")Integer id);

    @Insert("INSERT INTO `goodssource` (`supplierasid`,`goodsno`,`goodsname`,`goodsaddress`,`goodsphone`,`goodsemail`,`goodsremarks`,`linkmanname`)\n" +
            "VALUES (#{goodssource.supplierasid},#{goodssource.goodsno},#{goodssource.goodsname},#{goodssource.goodsaddress},#{goodssource.goodsphone},#{goodssource.goodsemail},#{goodssource.goodsremarks},#{goodssource.linkmanname})")
    int addgoodssource(@Param("goodssource")goodssource goodssource);

    @Select("SELECT * FROM `goodssource` WHERE `goodsid`=#{id}")
    goodssource queryone(@Param("id") Integer id);

    @Update("UPDATE `goodssource` \n" +
            "SET `goodsno`=#{goodssource.goodsno},`goodsname`=#{goodssource.goodsname},`goodsaddress`=#{goodssource.goodsaddress},`goodsphone`=#{goodssource.goodsphone},`goodsemail`=#{goodssource.goodsemail},`goodsremarks`=#{goodssource.goodsremarks},`linkmanname`=#{goodssource.linkmanname}\n" +
            "WHERE `goodsid` =#{id}")
    int updategoodssource(@Param("goodssource") goodssource goodssource,@Param("id")Integer id);
}